Commit Graph

20 Commits

Author SHA1 Message Date
CPunch 0a28dbcc3e removed util
- WaitWithTimeout && SelectWithTimeout have been moved to internal/testutil
- GetTime has been moved to cnet/protocol
2024-02-01 18:25:49 -06:00
CPunch 335fdb417c fix: add player to current chunk on LOAD_COMPLETE 2023-12-05 19:17:58 -06:00
CPunch 557117f093 moved internal/protocol -> cnet/protocol 2023-12-01 19:56:23 -06:00
CPunch af867ccff2 renamed cnet.CNPeer -> cnet.Peer 2023-12-01 19:15:00 -06:00
CPunch c60017f78f rename cnpeer package to cnet 2023-12-01 17:11:41 -06:00
CPunch bcc999db38 moved internal/entity to shard/entity 2023-12-01 16:56:55 -06:00
CPunch e355af19ab moved internal/protocol/cnpeer to cnpeer
also started a util package
2023-12-01 15:29:19 -06:00
CPunch f4b17906ce more protocol/service refactor
- removed protocol.Event: CNPeers now send protocol.PacketEvents
- peer uData is held in CNPeer, use SetUserData() and UserData() to
set/read it
- Service.PacketHandler calback has changed, removed uData:
switched calls to peer.SetUserData() and peer.UserData() where appropriate
- service.Service lots of tidying up, removed dependence on old
protocol.Event.
- service.Service && protocol.CNPeer now accept a cancelable context.
hooray graceful shutdowns and unit tests!
- general cleanup
2023-12-01 00:56:34 -06:00
CPunch 1f66acfd25 holy refactor
started out as me making a service abstraction..

- db.Player exists again, and entity.Player uses it as an embedded struct
- chunk.ForEachEntity() lets you add/remove entities during iteration now
- removed account related fields from CNPeer
- protocol/pool has been merged with protocol.
use protocol.GetBuffer() and protocol.PutBuffer().
- new protocol/internal/service!
service.Service is an abstraction layer to handle multiple CNPeer*
connections and allows you to associate each with an interface{} uData.
In the future it might also handle a task queue for jobs that
modify/interact with the player's uData, called from service.handleEvents()
- PacketHandler callback type has a new param! uData is passed as well now
- much of loginserver/shardserver is now handled by the shared service
abstraction
- SHARD: NPC_ENTER packets are now sent on player loading complete
rather than on enter.
2023-11-27 21:23:28 -06:00
CPunch 458e907c99 moved 'core' to 'internal' 2023-08-23 18:16:24 -05:00
CPunch 83b664da93 minor refactoring, fixed go-staticcheck warnings 2023-08-23 18:03:14 -05:00
unknown fd41b32b70 added NPCs; added tdata submodule
- use environment variable TDATA_PATH to specify the location of the
  tdata directory
2023-06-27 00:36:02 -05:00
CPunch c09a6cfd25 fixed sent server time 2023-06-25 18:29:31 -05:00
unknown 8f00a0c492 movement.go: added support for basic movement packets
you should be able to view other players and jump around together,
although while testing locally one of the clients would always trigger
the "Some irregularities have been found with your connection to the
server, so your game will be closed" speed check for some reason ???

really not sure, might just be my machine

chunking uhhh works ? kind of, not tested for more than a few seconds
before one of the clients disconnects
2023-06-25 04:27:42 -05:00
unknown f6ab7a9b5d started chunking 2023-06-25 03:33:17 -05:00
unknown f0b9bc6ed6 god forgive me for this commit 2023-06-25 01:51:21 -05:00
unknown dfc00bcb52 shardServer: simplified peer map logic 2023-06-24 22:36:04 -05:00
unknown 1da82ac750 include AccountID in loginMetadata 2023-06-22 18:12:31 -05:00
unknown d7445e0f0f Switched to redis/postgres, major refactoring
- loginMetadata is passed to shards through redis now
- shards announce they're alive via redis.AnnounceShard() which just
  populates a hashset keyed 'shards'
- login servers grab the 'shards' hashset and randomly picks a shard to
  pass the player to (for now)
- ./service shard && ./service login
- Many new environment variables, check config/config.go for more info.
  or for a tl;dr just read the Dockerfile for the required ones
- Shard and login services now run in different processes ! (and
  containers?? wooaaah)
2023-06-22 01:53:38 -05:00
CPunch 727c68aef3 server: split login/ and shard/ 2023-03-27 17:02:13 -05:00