Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
149 lines (119 loc) · 3.27 KB

File metadata and controls

149 lines (119 loc) · 3.27 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.*;
import Objects.*;
import Extensions.*;
/**
*
* @author admin
*/
public class XLuaObject {
public static final int COND_ERROR = 0;
public static final int COND_PRINT = 2;
public static final int MODE_DEFAULT = 0;
public static final int MODE_IMMEDIATE = 1;
public static final int MODE_QUEUED = 2;
public static final int MODE_EXPRESSION = 3;
public XLuaState state;
// public LPRDATA rdPtr;
public CExtension ho;
public Queue<String> errorQueue;
public Queue<String> printQueue;
public String errorString = "";
public String lastErrorString = "";
public String printString = "";
public String lastPrintString = "";
public int errorMode;
public int printMode;
public boolean runScript;
public boolean autoReg;
public boolean useBacktrace;
public int stateId;
public Map<String, XLuaScriptRecord> scripts;
public XLuaObject() {
errorQueue = new PriorityQueue<String>();
printQueue = new PriorityQueue<String>();
scripts = new HashMap<String, XLuaScriptRecord>();
}
void raiseError (String str) {
raiseError(str, MODE_DEFAULT);
}
void raiseError(String str, int mode) {
System.out.println("Raise Error: " + str);
if (errorQueue.size() >= 20) {
errorQueue.poll();
}
errorQueue.offer(str);
lastErrorString = str;
if (ho == null) {
return;
}
switch (mode) {
case MODE_DEFAULT:
case MODE_IMMEDIATE:
ho.generateEvent(COND_ERROR, 0);
break;
case MODE_QUEUED:
case MODE_EXPRESSION:
ho.pushEvent(COND_ERROR, 0);
break;
}
}
void raisePrint(String str) {
if (printQueue.size() >= 20) {
printQueue.poll();
}
printQueue.offer(str);
lastPrintString = str;
if (ho == null) {
return;
}
// TODO: Eventually handle errMode - thread safety issues
ho.pushEvent(COND_PRINT, 0);
}
String getError() {
if (!errorQueue.isEmpty()) {
errorString = errorQueue.poll();
return errorString;
}
errorString = "";
return errorString;
}
String getPrint() {
if (!printQueue.isEmpty()) {
printString = printQueue.poll();
return printString;
}
printString = "";
return printString;
}
void bindState(int sid) {
if (state != null) {
state.UnbindRd(this);
}
XLuaGlobal glob = XLuaGlobal.Get();
state = glob.GetState(sid);
if (state == null) {
glob.CreateState(sid);
state = glob.GetState(sid);
stateId = sid;
}
if (state != null) {
state.BindRd(this);
}
}
void unbindState() {
if (state != null) {
state.UnbindRd(this);
state = null;
}
}
String GetEmbeddedScript (String name) {
if (scripts.containsKey(name)) {
return scripts.get(name).script;
}
return "";
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.