Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

NP+ 1.7 - New Server - Version 0.03!

Ah, I thought my way was too easy.

The trouble is though, how would variables and switches be sent? They are huge arrays; I know how to convert them into a string but it's likely that string would exceed 4096 bytes with the amount of possible variables or switches. (Not that I use that many, but obviously it poses a limitation for the future.)
 
Commander Wyatt":31ktwken said:
Ah, I thought my way was too easy.

The trouble is though, how would variables and switches be sent? They are huge arrays; I know how to convert them into a string but it's likely that string would exceed 4096 bytes with the amount of possible variables or switches. (Not that I use that many, but obviously it poses a limitation for the future.)
just make it this way:
when /<10>@varname = (.*); @value = (.*)<\/10>/
edit_vars($1 , $2)
and then create edit_vars function...
if you need extra help MSN me: hagay9@013.net.il
and if you want to add db save you just send this:
<save></save>\n
because once again all the player data is stored in the
Client class..
 
Commander Wyatt":1a8ik92d said:
Ah, I thought my way was too easy.

The trouble is though, how would variables and switches be sent? They are huge arrays; I know how to convert them into a string but it's likely that string would exceed 4096 bytes with the amount of possible variables or switches. (Not that I use that many, but obviously it poses a limitation for the future.)

Well, In my game - I have a switches and variables table. Each with id, value and description. All entry's are changed variables, thus need to be send. I just send switch by switch and variable by variable. Every x I call Graphics.update, but since its only very short data (switch becomes : #GS2|1 for swith 2 is true etc.) it goes pretty fast ;).

Also, the 4096 bytes limit only counts for async commands. Just call get_command(...) from Netplay 2 (works well in 1.6 I suppose) and you can receive unlimited data. Though it is slower, because data is received byte wise instead of packet wise. In short, the method calls an method which does:

until (char = recv(1)) == "\n" do message += char end

So first you send a number request to the server (#GS) and then you iterate: n.times do get_switch end where get_switch simply calls a get_command(#GS), retrieves the data, evaluates the value and saves the switch. You COULD make a superlarge string from all the data anf just send #GS to the server to notify that it must now send the switch data and receive the data by get_command, but I don't know if that goes wrong if the string length becomes very large...
 
Me(tm)":3ufgxlsj said:
Commander Wyatt":3ufgxlsj said:
Ah, I thought my way was too easy.

The trouble is though, how would variables and switches be sent? They are huge arrays; I know how to convert them into a string but it's likely that string would exceed 4096 bytes with the amount of possible variables or switches. (Not that I use that many, but obviously it poses a limitation for the future.)

Well, In my game - I have a switches and variables table. Each with id, value and description. All entry's are changed variables, thus need to be send. I just send switch by switch and variable by variable. Every x I call Graphics.update, but since its only very short data (switch becomes : #GS2|1 for swith 2 is true etc.) it goes pretty fast ;).

Also, the 4096 bytes limit only counts for async commands. Just call get_command(...) from Netplay 2 (works well in 1.6 I suppose) and you can receive unlimited data. Though it is slower, because data is received byte wise instead of packet wise. In short, the method calls an method which does:

until (char = recv(1)) == "\n" do message += char end

So first you send a number request to the server (#GS) and then you iterate: n.times do get_switch end where get_switch simply calls a get_command(#GS), retrieves the data, evaluates the value and saves the switch. You COULD make a superlarge string from all the data anf just send #GS to the server to notify that it must now send the switch data and receive the data by get_command, but I don't know if that goes wrong if the string length becomes very large...
that will lead to lags and overload,
the data you send to the server
must be short and arranged..
just make it like you used to:
<5>...data...</5>\n
and the switches will be in diffrent command
<switch>@swtiches[#{switchid}] = true</switch>\n
in the server:
eval($1)
 
Dude,

First of all, never use eval - unless you want to give hackers a free pass. I know how TCP data protocol works and what you say is in no way different then what I said, except that I write <switch>@swtiches[#{switchid}] = true</switch>\n as DSid|value\n and that I use no eval.

So my way is safer and costs less bytes.
 
Me(tm)":2hxpsykg said:
Dude,

First of all, never use eval - unless you want to give hackers a free pass. I know how TCP data protocol works and what you say is in no way different then what I said, except that I write <switch>@swtiches[#{switchid}] = true</switch>\n as DSid|value\n and that I use no eval.

So my way is safer and costs less bytes.
I know how TCP works also,
eval won't hurt anyone it just work the same.
Hackers would know how to change the data sent, you can
ensure that you will have an encryption to protect from it.
 
Axules":3gt2j0qs said:
nowayskill":3gt2j0qs said:
Axules":3gt2j0qs said:
Still doesn't work for me. Same prolem.
It might happen because:
- You have a router
Neat, so everybody who has a router can't use it? Lol. So half of the people in here can't use it. =D
Yes ofcourse, every server can't run on a router
that a fact... you can run it on a router but outside connections
wouldn't be accepted because the router block the port.
Try using this host "localhost" that might work..
 
Any server can run on a router, you just need to go into the router's settings (mine does this by typing it's IP address into a web browser and logging in) and forward the port used to go to the computer the server is on.
 
Wyattina":1l8pwvrz said:
Any server can run on a router, you just need to go into the router's settings (mine does this by typing it's IP address into a web browser and logging in) and forward the port used to go to the computer the server is on.
Exactly there are routers that don't allow port forwarding like siemens.
 
I was using Netplay 1.6.3 I think about a year ago, it used a C server... I have not downloaded this yet, but, would it have lag after 3 people are online or is that fixed?
 
jcsnider":1m6dtyvw said:
I was using Netplay 1.6.3 I think about a year ago, it used a C server... I have not downloaded this yet, but, would it have lag after 3 people are online or is that fixed?
fixed
works for me with 20 people!
and everything is faster
actually this is NP + 1.6.3 but newer..
 
awesome, I will try it! I have not read this whole thread but could you supply a link to 1.7 client... I will look for it in the meantime
 
oh, figures... I will download now  :lol:


EDIT: it looks good, I cant test more than 1 person atm, but, it would be hard for alot of people to set up, it was very easy for me with xampp and stuff... maybe make a youtube vid on it or something:D Looks great though



Edit 2: My game, I quit on, because my scripts wouldnt work with 2.0 and 1.6.3 was too laggy... I fount my old backup files and put them in, I was able to snatch my lil sisters pc for a min to test more than 1 player, and I have to say... I am VERY impressed, you did great  :smile: (compared to what is was atleast)


If you dont mind me asking though... How much time did you put into making that server?
 
jcsnider":3l385lqe said:
oh, figures... I will download now  :lol:


EDIT: it looks good, I cant test more than 1 person atm, but, it would be hard for alot of people to set up, it was very easy for me with xampp and stuff... maybe make a youtube vid on it or something:D Looks great though



Edit 2: My game, I quit on, because my scripts wouldnt work with 2.0 and 1.6.3 was too laggy... I fount my old backup files and put them in, I was able to snatch my lil sisters pc for a min to test more than 1 player, and I have to say... I am VERY impressed, you did great  :smile: (compared to what is was atleast)


If you dont mind me asking though... How much time did you put into making that server?
Took me 3 Hours...
 
nowayskill":3m78j9hu said:
Wyattina":3m78j9hu said:
Any server can run on a router, you just need to go into the router's settings (mine does this by typing it's IP address into a web browser and logging in) and forward the port used to go to the computer the server is on.
Exactly there are routers that don't allow port forwarding like siemens.

Actually, all routers do have the capability. You just don't know where to look.

For example, the gigaset: http://portforward.com/english/routers/ ... zureus.htm
 
Me(tm)":d3brfnhv said:
nowayskill":d3brfnhv said:
Wyattina":d3brfnhv said:
Any server can run on a router, you just need to go into the router's settings (mine does this by typing it's IP address into a web browser and logging in) and forward the port used to go to the computer the server is on.
Exactly there are routers that don't allow port forwarding like siemens.

Actually, all routers do have the capability. You just don't know where to look.

For example, the gigaset: http://portforward.com/english/routers/ ... zureus.htm
tested it, not working... my friend HAD a siemens router and he tried that, well, not working..
 
Just a suggestion, I am not real framiliar with ruby so Im not sure on this, but, would it be possible to make the server accept the save file and make a folder by the username and save their data there, and make it so the game loads the data from there, it could be as simple as making the client just save to an ftp folder and back couldnt it?


*I maybe way off the topic of the server itself if I am plz just tell me and dont flame*
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top