-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnotes.txt
167 lines (131 loc) · 7.87 KB
/
notes.txt
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// clag = chunklag, localize lag to the chunks causing it by slowing down time inside laggy chunks.
* reflection docs : http://docs.oracle.com/javase/tutorial/reflect/index.html
* binary : by doing "gradlew.bat build" in command prompt at the project root
== 2014-03-18 sjphone : devanchan reported problem on TPPI
noone else online in server, place coal in single furnace, reported as slowed
http://puu.sh/7AaX5.png
== 2014-03-08 clag test notes
* DONE: option to dump to file coords of online players -> chat-command for test server to create chunkloaders at those positions
* DONE: count exceptions in tileloop, last coords + tile type
* DONE: partial code - option to add empty arraylist-stub that leaves vanilla tick intact
* DONE: partial code - option to add tile loop with just vanilla code for tick
* DONE: blacklist : option to NOT skip ticks for certain tile types -> applied energistics tile
* DONE: when clag is stopped, adjust output of commands to say so
* DONE: replace "arraylist.isProfiling()" by constant
* DONE: option to just start+stop at profile -> only warning
* DONE: measure time for profile tick and print in worst-command and console
* DONE: clag worst : show coords of worst chunk
* DONE: clag stats : list number of exceptions etc in chat
* DONE: last exception coords + type
* LATER: tile loop : sum by type during profile tick -> dump to file how many of each type were ticked
* LATER: count calls of arraylist stub calls
* LATER: print warning to all nearby players, check why it was printed twice
* LATER: option to require prem level 2 for admin commands
* LATER: clag tpworst : tp there
== 2014-03-08 blacklist example
I:blacklist <
62
63
64
>
== 2014-03-07 clag live test -> slow
C:\game\minecraft\mymod\archiv\2014-03-08-darius-code-nN1jhMNc.txt
public synchronized void updateTileEntity() { ...
/* 1302 */ for (TileRef m : this.AllMachines) {
/* */ try
/* */ {
/* 1305 */ ((IGridMachine)m.getTile()).setNetworkReady(true); !!!!!!!!
/* */ } catch (AppEngTileMissingException e) {
/* 1307 */ e.printStackTrace();
/* */ }
/* */ }
coords ???
2014-03-07 17:24:42 [SEVERE] appeng.api.exceptions.AppEngTileMissingException
2014-03-07 17:24:42 [SEVERE] at appeng.api.TileRef.getTile(TileRef.java:49)
2014-03-07 17:24:42 [SEVERE] at appeng.me.tile.TileController.updateTileEntity(TileController.java:1305)
2014-03-07 17:24:42 [SEVERE] at appeng.common.base.AppEngTile.func_70316_g(AppEngTile.java:713) // func_70316_g = updateTileEntity
2014-03-07 17:24:42 [SEVERE] at clag.CLagTileEntityTicker.runTileEntities(CLagTileEntityTicker.java:147) // tileEntity.updateEntity();
2014-03-07 17:24:42 [SEVERE] at clag.LoadedTileEntityList.tick(LoadedTileEntityList.java:18)
2014-03-07 17:24:42 [SEVERE] at clag.EntityList.doTick(EntityList.java:94)
2014-03-07 17:24:42 [SEVERE] at clag.EntityList.iterator(EntityList.java:206)
2014-03-07 17:24:42 [SEVERE] at net.minecraft.world.World.func_72939_s(World.java:2749)
2014-03-07 17:24:42 [SEVERE] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:883)
2014-03-07 17:24:42 [SEVERE] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:330)
2014-03-07 17:24:42 [SEVERE] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:777)
2014-03-07 17:24:42 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:659)
2014-03-07 17:24:42 [SEVERE] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
https://github.com/nallar/TickThreading/blob/master/resources/patches.xml#L1501
== permissions
in MCPC, all commands are assigned a permission node base off the classpath to the command class.
For example you would use clag.CLagCommand in a permission node to have access to that comand
sjphone : permissionnodes
http://wiki.ess3.net/wiki/Group_Manager
https://github.com/nallar/TickProfiler/tree/47631d5f2145d77d07545861e342ba361ec220e3/src/common/ru/tehkode/permissions
https://github.com/nallar/TickProfiler/blob/f88aa64e1db0c944aa65a48339beb709d1cbf896/src/common/me/nallar/tickprofiler/minecraft/commands/Command.java
== tickprofiler : profiling in separate thread ?
https://github.com/nallar/TickProfiler/blob/master/src/common/me/nallar/tickprofiler/minecraft/profiling/EntityTickProfiler.java
nope, just start(); thread{ sleep(); sync{ stop(); callback();}}
== tileentity sleep
public void TileEntity.updateEntity() {}
public void World.updateEntities()
=== profile chunk time (tileentities + rest)
NOTE: interesting! https://github.com/nallar/TickProfiler
main class : https://github.com/nallar/TickProfiler/blob/master/src/common/me/nallar/tickprofiler/minecraft/TickProfiler.java
public synchronized void hookProfiler(World world) { overrides loadedTileEntityField
https://github.com/nallar/TickProfiler/blob/master/src/common/me/nallar/tickprofiler/minecraft/entitylist/EntityList.java
TickThreading: The profiler mod is from tickthreading but without the extra features added.
https://github.com/nallar/TickThreading/tree/master/src/common/nallar/patched is where the patched MC files are
=== tile entities
World : this.loadedTileEntityList
idea: a tick handler that only executes like every 10 ticks. when it executes it accesses this list, removes all tile-entities in it that are in "slowed" chunks, and stores them it's own reactivation list (weak ref). 10 ticks later it re adds them if they're still "alive" so time doesn't stand completely still.
that'd slow down time in laggy chunks by half. for very laggy chunks we could setup a 2nd list to re-add them like 20 or 40 ticks later
== interesting : MCPC+ active chunk hook ?
https://github.com/nallar/TickProfiler/blob/master/src/common/me/nallar/tickprofiler/minecraft/profiling/EntityTickProfiler.java
private Method getIsActiveChunkMethod() {
Class<World> clazz = World.class;
try {
Method method = clazz.getDeclaredMethod("isActiveChunk", int.class, int.class);
Log.info("Found MCPC+ isActiveChunk method " + method);
return method;
} catch (NoSuchMethodException e) {
Log.info("Did not find MCPC+ isActiveChunk method, assuming vanilla entity ticking.");
}
return null;
}
== snippet : access to privat fields
WorldRenderer[] worldRenderers = null;
try {
Field field1 = rg.getClass().getDeclaredField("worldRenderers");
field1.setAccessible(true);
worldRenderers = (WorldRenderer[])field1.get(rg);
} catch (Exception e)
{
FMLLog.info("GShipRender.MyGetWorldRenderer setAccessible fail");
}
=== forge event
see http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/
World.updateEntityWithOptionalForce
if (!canUpdate)
{
EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(par1Entity);
MinecraftForge.EVENT_BUS.post(event);
canUpdate = event.canUpdate;
}
if (canUpdate)
{
..
}
=== gradle setup :
command prompt :
* gradlew.bat build
* gradlew.bat setupDevWorkspace
* gradlew.bat eclipse
HOWTO: Getting Started with ForgeGradle : http://www.minecraftforge.net/forum/index.php?topic=14048.0
* deploy : gradew.bat build
** C:\game\minecraft\mymod4\build\libs CLagID-1.0.jar
** build.gradle version = "0.0.1"
* show all options : gradlew.bat tasks
== general nots
* minecraft server wrapper (replacement for linux screen) : https://github.com/mcdevs/mark2
* code/assembly injection http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/
* tick-threading : https://github.com/nallar/TickThreading