|
|
Line 19: |
Line 19: |
| Integrating network code into Oni. | | Integrating network code into Oni. |
|
| |
|
| ==Player to Player Communication==
| |
| [[Image:Flatline_1.PNG|right|thumb|300px|A mock up of the chat+score system]]
| |
| ===Scores===
| |
|
| |
|
| |
| Console write, functionality already in Daodan.
| |
|
| |
| ===Chat===
| |
|
| |
| Chat will probably be handled through an popup input through the daodan.
| |
|
| |
| ==Internal Communication==
| |
|
| |
| ===Player to Server===
| |
|
| |
| *Key bitset
| |
| *Mouse X\Y
| |
|
| |
| ===Server to Player===
| |
|
| |
| *Bitsets+XY for all other players
| |
| *XYZ location
| |
| *Rotation
| |
|
| |
|
| |
| ==Dev Mode+Cheats==
| |
|
| |
| Only the server itself would have dev mode enabled. Admins would be able to send commands to the server through chat. All players have cheats disabled. (Enforceable through Daodan etc.)
| |
|
| |
| ==Packets== | | ==Packets== |
| ;Warning, this isn't the most thought out of sections.
| | ===Structure=== |
| | | typedef struct { |
| '''PPPPYYZZZZ…'''
| | char id; |
|
| | int packet_index; |
| '''PPPP''' = Destination players. Hex =>Binary etc If player limit was kept at 6, only one byte would be needed. Any more than that requires one more byte. Player => Server communication uses 0000 Server=> All players uses FFFF
| | char data[1080]; |
| {|align=right | | } flatline_packet; |
| |http://gumby.oni2.net/Flatline/flatline2.PNG
| | *id is an identifier the specific type of packet being sent (message, character sync, initial connection, etc...) |
| |}
| | *packet_index is used to protect against duplicate packets. Each packet gets a unique indentifier, if a duplicate is found, the packet is ignored. |
| '''YY''' =.Datatype
| | *data contains the actual data for the packet, and is typically cast to another struct. The largest struct needed so far is 1080 bytes. In theory, we can go up to 1400 bytes. |
| *01 = Dev console command
| |
| *02 = Keyboard bitset+XY | |
| *03 = XYZ position
| |
| *04 = etc.
| |
| | |
| '''ZZZZ…''' = Data used with YY.
| |
| | |
| '''Example:'''
| |
| | |
| FFFF 01 646D7367282248656C6C6f20576f726C642229
| |
| | |
| Server is sending to all players to execute the Dev console command “dmsg("Hello World")”
| |
| | |
| ==Cycling==
| |
| | |
| ===Class Changing===
| |
| | |
| As dev mode is disabled (along with all cheats), we can use the Daodan to detect F8 being pressed, and not worry about the game also using that input.
| |
| | |
| At connection, the server would send a list of available characters. Pressing F8 in game (if allowed by server) sends out a dev mode command to all players to “chr_set_class player nextmodel”. Player being the player name or number, and nextmodel being pulled from the list.
| |
|
| |
|
| ===Gun Cycling=== | | ===Connecting=== |
| | #Client sends a packet asking to connect to a server |
| | #Server sends a packet back, saying if the client can connect or not, including a string to display if the connection was rejected |
| | #Client either recieves said packet or times out after 15 seconds if no packet is recieved back (sending a new connection request packet every so often before that). |
| | #Server sends basic game info to client, including a packet containing a mock BINACHAR for each player currently connected to the server. |
|
| |
|
| If available (and implemented) gun cycling would work much like the above.
| | #Client sends packets containing keystrokes and other commands |
| | #Server sends back xyz\animation\whatever data |
|
| |
|
| ==Maps== | | ==Maps== |