Commit Graph

81 Commits

Author SHA1 Message Date
Jocke aadfdfdd90 AmmoPickups and HealthPickups will only spawn on the server. When a ammo pickup is taken the Server will send an Event to that
Client and it will update its ammo.
2016-03-01 17:55:00 +01:00
Jocke 18450ff4f3 Death explosion should always get triggered now. (I hope) 2016-02-26 11:08:05 +01:00
Jocke eac9a9daf6 Pull request #136 Merge remote-tracking branch 'origin/master' into FixNetworkBugs
# Conflicts:
#	src/Engine/Network/Client.cpp
2016-02-25 16:07:06 +01:00
Jocke 059fe5c6c0 Fixed typo m_EPDoubleJump to m_EDoubleJump. 2016-02-25 16:04:27 +01:00
Jocke f66fa7a183 Merge remote-tracking branch 'origin/master' into FixNetworkBugs
# Conflicts:
#	include/Engine/Network/Client.h
#	include/Engine/Network/MessageType.h
#	include/Engine/Network/Server.h
#	include/Engine/Network/TCPServer.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/TCPServer.cpp
2016-02-25 15:13:11 +01:00
stiffly 8ce6308649 In snapshot: now sends player information and also CP information. Now it is no longer true that they will arrive in pre order. Appropriate actions were therefor implemented. 2016-02-25 11:56:40 +01:00
Jocke fa13c1d065 Double jump is now working. 2016-02-23 18:24:46 +01:00
stiffly 833006744a WIP 2016-02-22 17:00:25 +01:00
stiffly 993d804cef Added an event to search for servers.
Client now broadcasts a serverlistrequest.
An active server will then answer the request and send info about the server.
The client saves this data to a list and presents it to the user.
2016-02-22 10:05:47 +01:00
stiffly 46987beefb Updated the serverlist, now prints adress and port of the server. 2016-02-17 17:05:10 +01:00
stiffly fdc8f753cb Implemented primitive server "heartbeat" logic, which sends server info from server to client without being connected. 2016-02-17 15:51:26 +01:00
Jace bb66f95d43 Enabled server broadcasting PlayerDamage events to other players to make damage indicators work 2016-02-12 07:03:14 +01:00
stiffly afd9e24df6 Reverted last commit. Also testing to delay OnPlayerSpawn event for clients. No progress... 2016-02-11 21:23:53 +01:00
Jocke e0c3a32e66 Merge branch 'master' into TCPConnections
# Conflicts:
#	include/Engine/Network/Client.h
#	include/Engine/Network/Server.h
#	include/Game/Game.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Server.cpp
#	src/Game/Game.cpp
2016-02-11 16:26:42 +01:00
Jocke eb244f87c4 Added disconnect functionality and removed some warnings. 2016-02-10 23:27:46 +01:00
Jocke 9645169797 Merge remote-tracking branch 'origin/master' into TCPConnections
# Conflicts:
#	include/Engine/Network/Client.h
#	include/Engine/Network/Network.h
#	include/Engine/Network/Packet.h
#	include/Engine/Network/Server.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Packet.cpp
#	src/Engine/Network/Server.cpp
#	src/Tests/HealthSystemTest.cpp
2016-02-10 17:05:07 +01:00
Jocke 4f2ad3ad00 Reliable message should now be working, further testing is to be done. 2016-02-10 16:16:56 +01:00
Jocke 2ec30fd2b2 Cleaned up code and fixed crash when closing client before server when using udp. 2016-02-10 11:28:03 +01:00
Jace d3bc48f5f7 Major networking refactoring to allow for snapshot filtering outside of netcode 2016-02-09 13:22:21 +01:00
Jocke fccd8c64e7 WIP Clients are working properly, servers are not. 2016-02-09 11:43:16 +01:00
Jocke 88d7b79cd3 TCP and UDP Client are working for 1 connected player, more players are not tested yet 2016-02-05 18:30:31 +01:00
Jocke 9232b24a7b WIP Reliable message 2016-02-04 15:49:04 +01:00
Jocke e133791369 WIP Reliable Message 2016-02-03 10:28:15 +01:00
Jocke 6a3f585fb9 Fixed warnings associated with Network.cpp, Client.cpp, Server.cpp and Packet.cpp.
BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT': macro redefinition was fixed by https://svn.boost.org/trac/boost/ticket/11539
2016-02-02 13:26:15 +01:00
Jace 0fb1dbcae1 Client now has authority over its own absolute position and orientation until we have reliable input messaging 2016-01-24 19:00:50 +01:00
stiffly 2eaad2aa00 Client now responds to deleted entity and component in server 2016-01-24 17:16:26 +01:00
Jace 4d5cbb6057 fixup! Added EntityWrapper::IsChildOf and made snapshot interpolation and rendering exceptions for player less hacky 2016-01-23 12:14:29 +01:00
stiffly 389e057611 EPlayerSpawned special logic added to server and client. 2016-01-22 17:49:21 +01:00
stiffly 08c476e9e3 Added kick logic to the server. Also typedefed. 2016-01-22 15:42:36 +01:00
stiffly 08fcdb382b Used config for a lot of things 2016-01-22 13:18:53 +01:00
Jocke 6cd073c3c8 Added network metrics logging and reactored code. 2016-01-22 10:32:54 +01:00
Jocke cd67253173 Added logic to go from spectator to player. 2016-01-20 17:41:16 +01:00
stiffly 3376f4a16e Added server has timed out logic to client. (>'')> 2016-01-20 16:27:53 +01:00
Jocke fc305f8bf4 Merge remote-tracking branch 'origin/Networking' into Networking 2016-01-18 17:27:55 +01:00
Jocke 0c7f2c5198 WIP implemented Interpolation (server logic) 2016-01-18 17:12:42 +01:00
Jocke d995713d3b Added input queue to Client and Input Listener debug code in server. 2016-01-18 11:06:02 +01:00
Jocke 696f44a673 Added logic for mapping between ServerEntityIDs and LocalEntityIDs removed old code that wasn't used.
Added 1 map to Client and renamed m_ServerToClientMap to m_ServerIDToClientID.

// Good to know
To keep this structure please use insertIntoServerClientMaps() when adding items to them.
m_ServerIDToClientID and m_ClientIDToServerID maps between server EntityIDs and local EntityIDs.
To see if a local EntityID exist in m_ClientIDToServerID use clientServerMapsHasEntity(EntityID clientEntityID);
To see if server EntityID exist in m_ServerIDToClientID use serverClientMapsHasEntity(EntityID serverEntityID);
2016-01-14 17:11:54 +01:00
Jocke db18a45368 We are now sending EPlayerDamage events.
Client now listens to EPlayerDamage events and send them to Server.
Server publishes EPlayerDamage events received from Client.
2016-01-14 10:16:11 +01:00
Jocke a060640da3 Removed unnecessary unnecessary if in Client::OnInputCommand.
Change name from Server::parseEvent to Server::parseOnInputCommand
2016-01-13 18:00:12 +01:00
Jocke f47f913bf5 Added logic for sending input from Client to Server.
Fixed so that snapshots set their parent correctly. Will get problems if we have more components
than unsigned int max size, but that was already a problem.
Client now maps Entitys received from server with local Entitys by mapping their EntityIDs.
2016-01-13 16:09:16 +01:00
Jocke 2284399538 Removed Close method from Client, Server and Network.
Removed legacy variable m_ThreadIsRunning in Client.h and Server.h.
Removed m_EventBroker->Unsubscribe(m_EInputCommand) in Client destructor.
2016-01-12 17:47:03 +01:00
Jocke 236230d12c Packets now dynamically allocates more memory when they need it.
Increased local receive buffer for Client and Server() and removed the magic number that was used
In Server.h and Client.h
(char readBuffer[INPUTSIZE] = { 0 }).
Packets start size has now been increased to 512 bytes.
Changed ComponentInfo::FieldsInOrder to store strings instead of pointers.
Removed HasEntity() and are now using ValidEntity() instead.
2016-01-12 12:00:19 +01:00
stiffly a858dab8b6 Network not longer threaded 2015-12-18 12:00:14 +01:00
stiffly 6d649e4d35 Merge remote-tracking branch 'origin/Networking' into Networking
# Conflicts:
#	src/Engine/Network/Client.cpp
2015-12-18 11:26:48 +01:00
stiffly 5c1a93021b Client now reads address and port from config file. Default address is set to local host. 2015-12-18 11:22:13 +01:00
Jocke ad43cc44c3 Merge remote-tracking branch 'origin/Networking' into Networking 2015-12-18 11:03:21 +01:00
Jocke 30db0b10fd Removed NetworkDefinitions.h and moved #define MAXCONNECTIONS 8
#define INPUTSIZE 128 to Network.h.
2015-12-18 10:36:14 +01:00
Jocke 97f8be1915 Made Network.h's Start() and Update pure virtual and removed cpp.
Removed unnecessary code from NetworkDefinitions.h.
Renamed sizeOfPackage to sizeOfPacket in Packet.cpp.
2015-12-18 10:21:56 +01:00
stiffly 0b714e593f Removed WinLeakCheck. Minor variable name changes. removed IsWASDKeyDown struct 2015-12-17 17:56:15 +01:00
stiffly 076030a252 Fixes, mostly name changes 2015-12-17 17:28:43 +01:00