remove() public method

public remove ( ) : CallResponse,
return CallResponse,
コード例 #1
0
    void Update()
    {
        if (queue.notEmpty())
        {
            CallResponse call = queue.remove();

            try{
                //Debug.Log("Trying to eval '" + call.getCall() + "'");

                if (call.getCall().Equals("\n"))
                {
                    call.setResponse("");
                }
                else
                {
                    if (!call.getCall().StartsWith("util."))
                    {
                        TraceLogger.LogTrace(call.getCall());
                    }

                    object ret = Eval.eval(call.getCall(), ObjectManager.GetObjects(), new Util());

                    string response = "";
                    if (ret != null)
                    {
                        response = ret.ToString();
                    }

                    //Debug.Log("Response was " + response);
                    call.setResponse(response);
                }
                call.respond();
            } catch (Exception e) {
                Debug.Log(e.Message);
                Debug.Log(e.StackTrace);
                call.setResponse("Error: " + e.ToString().Replace("\n", ""));
                TraceLogger.LogError(call.getResponse());
                call.respond();
            }
        }
    }
コード例 #2
0
ファイル: StartServer.cs プロジェクト: srfoster/June
    void Update()
    {
        while (queue.notEmpty())
        {
            CallResponse call = queue.remove();

            try{
                Debug.Log("Trying to eval '" + call.getCall() + "'");

                if (call.getCall().Equals("\n"))
                {
                    call.setResponse("");
                }
                else
                {
                    string response = Eval.eval(call.getCall()).ToString();
                    call.setResponse(response);
                }
                call.respond();
            } catch (Exception e) {
                call.setResponse("Error: " + e.ToString().Replace("\n", ""));
            }
        }
    }