コード例 #1
0
ファイル: SV_MAIN.cs プロジェクト: optimus-code/Q2Sharp
        public static void SV_DropClient(client_t drop)
        {
            MSG.WriteByte(drop.netchan.message, Defines.svc_disconnect);
            if (drop.state == Defines.cs_spawned)
            {
                PlayerClient.ClientDisconnect(drop.edict);
            }

            if (drop.download != null)
            {
                FS.FreeFile(drop.download);
                drop.download = null;
            }

            drop.state = Defines.cs_zombie;
            drop.name  = "";
        }
コード例 #2
0
        /**
         * Called when the player is totally leaving the server, either willingly or
         * unwillingly. This is NOT called if the entire server is quiting or
         * crashing.
         */
        public static void SV_DropClient(client_t drop)
        {
            // add the disconnect
            MSG.WriteByte(drop.netchan.message, Defines.svc_disconnect);

            if (drop.state == Defines.cs_spawned)
            {
                // call the prog function for removing a client
                // this will remove the body, among other things
                PlayerClient.ClientDisconnect(drop.edict);
            }

            if (drop.download != null)
            {
                FS.FreeFile(drop.download);
                drop.download = null;
            }

            drop.state = Defines.cs_zombie;             // become free in a few seconds
            drop.name  = "";
        }