Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, ozgur), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Server > Unique Client - [Help] [Re: indiGLOW] #222746
08/20/08 20:27
08/20/08 20:27
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
The server sets client id in the player function that was given on the client when he ent_created the entity on the server... smile
After the server sets this client id , he sends it to all clients just before he sets my.nosend on.
Later , you go thru the list of clients , check if this ID is the same as the current entity on the list...If it is , send_var_to smile I never used send string instructions btw :P

What I didnt mention was , on the client , when a client receives a var , event_var is activated in the client event function (or was it another event name? I forgot already laugh )
If event var has been received , and the updating arrays first var is empty , calls a function that manages the updating array and distributes it to the entitys skills. After that it sets the updating array to 0. This will enshure , that , if you send another var , the updating vars Client ID is 0 , so , no updating will occur.

You've got it right , I just wanned to explain it better to avoid confusion smile
fastlane , I tought you used a plugin :P ?


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Server > Unique Client - [Help] [Re: EpsiloN] #222756
08/20/08 21:32
08/20/08 21:32
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Ok so during the server join event, I find an available player slot and broadcast a message to every client.

The string has a command code, and clients without an assigned ID get this number and assign it their client entity they created on the server.

the server should then be able to scan through all entities until it finds one with a matching ID and then send a message to that client through this entity.

Here's the final snippet, maybe there is something wrong here?

Code:
				// Find new Client entity 
				you = ent_next(null);
				while(you!=null){
					if(you._client)&&(you.player == tempID){me=you;}
					you = ent_next(you);	
				}
				SEND_STRING_TO(me, "Registered");


Currently the string "Registered" does not show up on the client. Any pointers?

Also I have noticed that some of my broadcast strings are not showing up complete on the clients. I send "Registered" but the clients display "Reg" any suggestions?

Thanks guys


The Art of Conversation is dead : Discuss
Re: Server > Unique Client - [Help] [Re: indiGLOW] #222781
08/20/08 23:58
08/20/08 23:58
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
i'm reading this thinking that the ways i did it in A6 was really cr&p, now it seems everyone does it this way...

what i did was to create a login screen, then the client would click login after inputing his name and password and session_connect... this then sent a message to the server including the player_name (clients username), and password and then checked with the details the server held,

if all was ok at this point, the server would send back a message to all clients, but specifying it was for this certain client, so all other clients would ignore it... the recipient would update it's player_name with this requested username and giving it a unique ID,

any forthcoming messages would then reference this player_name so there is no chance of duplicaiton of username, and all updates would be done like this... unfortunately using this method all clients have to receive the string to realise if it's intended for them or not, and then act accordingly

this did have it's advantages however... if i was sending a string to a guild_name everyone in that guild would receive the string and act accordingly, and similarly to a team, raid or a private message. as long as i put enough information in that string for the client to determine what to do with it

hopefully this isn't the way everyone is thinking of doing things, but atm the way i'm reading it, it seems to be the only possible answer... smirk

Re: Server > Unique Client - [Help] [Re: indiGLOW] #222832
08/21/08 03:42
08/21/08 03:42
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
When an event join is trigerred , you still dont have an entity for that client...maby thats the problem smile
You should set that ID number in the player function , so that you know for shure it is attached to a skill of your player entity.

As for the strings , you need a pointer , I think.
Code:
str_cpy(send_str,"Registered");
send_string_to(me,send_str);



Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Server > Unique Client - [Help] [Re: EpsiloN] #223239
08/22/08 20:19
08/22/08 20:19
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
I was pretty sure the server would not have a pointer assigned to the new client during the join event. I think this is exactly why the SEND_STRING_TO required an entity created by the client.

I also believe my script allows the client to join, get assigned a unique ID, create an entity on the server and set it's skill to the ID given out by the server.

I think there is a possibility I am going wrong here; maybe my entity skills are out of synch because I am getting the server to search for this new client during the join event itself? regardless of sleep(2)?

I have created a 2 second delay during the join_event, to allow the client to get the ID, spawn the entity and assign the skill. After the 2 seconds the server searches for an entity matching the ID and then sends a string to it directly.

Could it be the client created entity is not updated it's skill on the server?

I will look into this over the weekend. It would be fantastic if someone could give me a code snippet that demonstrates this. I keep thinking its the SEND_STRING_TO function itself, or maybe my A6.6 pro is acting up

As for the string issue, I have checked my code and I am passing the string through a function with a (_string) handler, and while I did have a few direct "" strings, it seems to be missing characters for all ways of sending.

I am going to have a crack at your example code.


The Art of Conversation is dead : Discuss
Re: Server > Unique Client - [Help] [Re: indiGLOW] #223833
08/26/08 21:16
08/26/08 21:16
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Time for an update: Let me first tell you / show you where I am at:



In the above image you can see I have managed to get a client/host running, (larger image right)and 2 seperate clients (2 smaller images left), with each client and the server creating their own unique eyeball.

Each eyeball is following the server or clients own dev-cam, so gives a realtime representation of where they are in the world, and where they are looking.

All this is pretty cool. I've even got it running over the internet and performance is good.

However. It's all achieved on a wing and a prayer.

  • When clients disconnect the server has no clue who it was and so the clients entity stays resident.
  • when running over internet, server crashes when more than 1 client joins
  • I am still getting my head around where and when these functions are running
  • loads of un-needed stuff is being sent all the time
  • I am still not convinced I am getting unique pointers to clients, or am able to send exclusive strings


The quest into MP continues. - I've already been dealt a bombshell about encryption and A6, so I had to find something positive smile

Any help on the above listed items is welcome - TIA


The Art of Conversation is dead : Discuss
Re: Server > Unique Client - [Help] [Re: indiGLOW] #223889
08/27/08 03:42
08/27/08 03:42
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Theres an event for disconnection , I'm not shure it was event_disconnect exactly smile look the manual. With the event , you dont need to know wich client disconnected.
About the other problems , I'd suggest you start again. I've written my MMO scripts over 15 times smile and the last one looks clean and works good and I know how to make it again in less than a day...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Server > Unique Client - [Help] [Re: EpsiloN] #223904
08/27/08 16:22
08/27/08 16:22
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
I have no doubt I will write this over and over and over again. Then when I think it's right, i'll write it again smile

Thanks Epsilon smile


The Art of Conversation is dead : Discuss
Re: Server > Unique Client - [Help] [Re: EpsiloN] #223907
08/27/08 16:31
08/27/08 16:31
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Quote:
fastlane , I tought you used a plugin :P ?


Nope. The only plugins we use are 1) a MySql plugin and 2) a number converter so we can store Vars accurate to .001 into MySql.

Out client update routine is much like you described. We assign each client a unique id from a master table and we transmit that ID to all clients. Then, whenever a message is sent (by string), this unique ID helps to identify which client the message is for. We use this technique to help us only move the clients we want... so that if Clients b-d are moving close to Client A but not close to Clients e-z, then we send a string with the instructions and unique id's for clients a-d and thus only people near you move.

No plugin needed for this, though a horrible pain to design and test to work.... which is why this is still tops on my list of "things the engine should do" since our system is nothing more than a bunch of lookup tables that we constantly have to reference. frown

Re: Server > Unique Client - [Help] [Re: indiGLOW] #223908
08/27/08 16:41
08/27/08 16:41
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Quote:
However. It's all achieved on a wing and a prayer.

* When clients disconnect the server has no clue who it was and so the clients entity stays resident.


When you event_disconnect is called, before you run ent_remove, reference the skill upon which you have the client_ID and then use that to remove all client_ID's from everywhere.

Quote:

* when running over internet, server crashes when more than 1 client joins


That is not normal. Your login routine is not stable yet. You are likely over-righting on the wrong array or net index when coming in causing the server to crash. You should be able to debug this with proficient use of the Diag() command and acklog_sv.txt file.

Quote:

* I am still getting my head around where and when these functions are running


That's a good thing to get your head around, especially with MMOG. I recommend (if you haven't already) you look into UML diagramming and start diagramming your code. Trust me, it will seem like a waste of time at first, but in time, as the code grows and dependencies develop, it will be an invaluable tool in putting it all together.

Quote:

* loads of un-needed stuff is being sent all the time


Again, with UML you can map out your network traffic. Make sure you are using the Dplay_ function to set your server and client clocks. As well, pay attention to the nosends (I like to do nosend_all myself). Finally, get a Packet Sniffer to read through the packets you are sending. This will help identify what is being put on the net and this will help you find where it's coming from.

Quote:

* I am still not convinced I am getting unique pointers to clients, or am able to send exclusive strings


Let's not use the word "pointer" here shall we since it already has meaning in the engine. Instead, stick to "unique ID". wink

I'm surprised you are unable to send exclusive strings. This is something that A6 and A7 can do quite effortless. However, combining a unique client ID with sending strings can be confusing. In our case, we have a lookup table that converts our unique IDs into GS Handles. This way, whenever it comes time to put something on the network, we take the lookup the handle for a unique ID, use handle_to_pointer to get the pointer, and then use the pointer to send on. Convoluted but aside from the extra conversion step, quite easy.

Page 2 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1