RunScriptOnServer() public method

Run a script on a remote server. The script must exist on the server. If acknowledgement is desired, it must be implemented in the form of a reply IPC request initiated by the script invoked. A script executed by this function must follow this prototype: void main(int SourceServerID, string Argument);
public RunScriptOnServer ( int DestinationServerID, string ScriptName, string ScriptArgument ) : void
DestinationServerID int Supplies the destination server /// ID.
ScriptName string Supplies the name of the script.
ScriptArgument string Supplies an optional argument to pass /// to the script.
return void
        /// <summary>
        /// This method is called when a portal transition has been committed
        /// to send a player to a remote server.
        /// </summary>
        /// <param name="State">Supplies the local state for the player that is
        /// committed to a portal transition.
        /// </param>
        /// <param name="Server">Supplies the destination server for the portal
        /// event.</param>
        /// <param name="Script">Supplies the script object.</param>
        public static void SendGUIStateToServer(PlayerState State, GameServer Server, ACR_ServerCommunicator Script)
        {
            //
            // Build the resynchronization command.  The resynchronization
            // command is parsed by HandleGUIResync().  Note that the remote
            // and local servers may not be of the same version, i.e. the
            // remote server may not understand fields that are created by the
            // local server if it is of a newer version.
            //

            ResyncState ResyncInfo = new ResyncState(State.PlayerId, 0);

            if (State.ChatSelectGUIExpanded)
            {
                ResyncInfo.ResyncFlags |= RESYNC_FLAG_CHAT_SELECT_EXPANDED;
            }

            //
            // Dispatch the resync script execution request to the remote
            // server.  The remote server will process it when the request has
            // been received.
            //

            Script.RunScriptOnServer(Server.ServerId, "acr_resync_gui", ResyncInfo.ToString());
        }
Example #2
0
        /// <summary>
        /// This method is called to request an IPC channel latency measurement
        /// to a target server.
        /// </summary>
        /// <param name="PCObjectId">Supplies the PC object id of the
        /// requesting player.</param>
        /// <param name="ServerId">Supplies the server id to send the ping
        /// request to.</param>
        /// <param name="Script">Supplies the script object.</param>
        public static void SendPingToServer(uint PCObjectId, int ServerId, ACR_ServerCommunicator Script)
        {
            //
            // Package and serialize the ping state for transmission to the
            // remote server.  The remote server will echo the ping back, and
            // HandleServerPingResponse will then be invoked via a reply
            // run script request for acr_ping_server_response.
            //

            PingState State = new PingState(PCObjectId, Environment.TickCount);

            Script.RunScriptOnServer(ServerId, "acr_server_ping_request", State.ToString());
        }
        /// <summary>
        /// This method is called when a portal transition has been committed
        /// to send a player to a remote server.
        /// </summary>
        /// <param name="State">Supplies the local state for the player that is
        /// committed to a portal transition.
        /// </param>
        /// <param name="Server">Supplies the destination server for the portal
        /// event.</param>
        /// <param name="Script">Supplies the script object.</param>
        public static void SendGUIStateToServer(PlayerState State, GameServer Server, ACR_ServerCommunicator Script)
        {
            //
            // Build the resynchronization command.  The resynchronization
            // command is parsed by HandleGUIResync().  Note that the remote
            // and local servers may not be of the same version, i.e. the
            // remote server may not understand fields that are created by the
            // local server if it is of a newer version.
            //

            ResyncState ResyncInfo = new ResyncState(State.PlayerId, 0);

            if (State.ChatSelectGUIExpanded)
                ResyncInfo.ResyncFlags |= RESYNC_FLAG_CHAT_SELECT_EXPANDED;

            //
            // Dispatch the resync script execution request to the remote
            // server.  The remote server will process it when the request has
            // been received.
            //

            Script.RunScriptOnServer(Server.ServerId, "acr_resync_gui", ResyncInfo.ToString());
        }
        /// <summary>
        /// This method is called to request an IPC channel latency measurement
        /// to a target server.
        /// </summary>
        /// <param name="PCObjectId">Supplies the PC object id of the
        /// requesting player.</param>
        /// <param name="ServerId">Supplies the server id to send the ping
        /// request to.</param>
        /// <param name="Script">Supplies the script object.</param>
        public static void SendPingToServer(uint PCObjectId, int ServerId, ACR_ServerCommunicator Script)
        {
            //
            // Package and serialize the ping state for transmission to the
            // remote server.  The remote server will echo the ping back, and
            // HandleServerPingResponse will then be invoked via a reply
            // run script request for acr_ping_server_response.
            //

            PingState State = new PingState(PCObjectId, Environment.TickCount);

            Script.RunScriptOnServer(ServerId, "acr_server_ping_request", State.ToString());
        }