Пример #1
0
        public override void OnNetworkInstantiated(NetCreatableInfo stateInfo)
        {
            base.OnNetworkInstantiated(stateInfo);

            SnapshotNetComponent snc = AOSServer.Instance.GetComponent <SnapshotNetComponent>();

            ClientSnapshot = new ClientPlayerSnapshot(snc.SnapshotSystem, stateInfo.Owner, true);
        }
Пример #2
0
        public NetPlayerComponent(AOSServer server)
            : base(server)
        {
            netPlayers        = new BiDictionary <NetConnection, NetworkPlayer>();
            stashedClientInfo = new Dictionary <NetConnection, ClientInfo>();
            channel           = server.GetChannel(AOSChannelType.NetInterface);
            snapshotComponent = server.GetComponent <SnapshotNetComponent>();

            channel.AddRemoteEvent("Server_ClientInfo", R_ClientInfo);
        }
        public CharacterSnapshotSystem(SnapshotNetComponent snapshotComponent, SnapshotSystem deltaSnapshotSystem)
        {
            this.snapshotComponent   = snapshotComponent;
            this.deltaSnapshotSystem = deltaSnapshotSystem;

            players = new Dictionary <ushort, ServerMPPlayer>();
            playersFromConnection = new Dictionary <NetConnection, ServerMPPlayer>();

            DashCMD.SetCVar("log_css", false);
        }
Пример #4
0
        public ServerWorld()
        {
            players      = new ConcurrentDictionary <NetConnection, ServerMPPlayer>();
            physEntities = new Dictionary <ushort, GameObject>();

            server            = AOSServer.Instance;
            snapshotComponent = server.GetComponent <SnapshotNetComponent>();
            objectComponent   = server.GetComponent <ObjectNetComponent>();
            channel           = server.GetChannel(AOSChannelType.World);

            channel.AddRemoteEvent("Server_SetBlock", R_SetBlock);
            channel.AddRemoteEvent("Server_ThrowGrenade", R_ThrowGrenade);
            channel.AddRemoteEvent("Server_ShootMelon", R_ShootMelon);

            objectComponent.OnCreatableInstantiated   += ObjectComponent_OnCreatableInstantiated;
            objectComponent.OnCreatableDestroyed      += ObjectComponent_OnCreatableDestroyed;
            snapshotComponent.OnWorldSnapshotOutbound += Server_OnWorldSnapshotOutbound;

            InitializeCMD();

            ConfigSection gameSection = Program.Config.GetSection("Game");

            if (gameSection == null)
            {
                DashCMD.WriteError("[server.cfg - ServerWorld] Section 'Game' is missing!");
            }
            else
            {
                string worldFile = gameSection.GetString("world-file");

                if (!string.IsNullOrWhiteSpace(worldFile))
                {
                    LoadFromFile(worldFile);
                }
                else
                {
                    DashCMD.WriteError("[server.cfg - ServerWorld] Game.world-file is missing!");
                }
            }
        }
Пример #5
0
 public override void Initialize()
 {
     snapshotComponent = server.GetComponent <SnapshotNetComponent>();
     snapshotComponent.OnWorldSnapshotOutbound += SnapshotComponent_OnWorldSnapshotOutbound;
     base.Initialize();
 }