最近清理桌面,扔了还是比较可惜

[edit] Spring runs synchronized on all computers
Spring’s networking is built upon the assumption that all player’s simulations are in sync and only send their (or their AI’s) input over the network. This mean that you will have to be very careful to keep the simulation deterministic. Here is a few pointers to think about.
spring的网络通信建立在一个基本假设之上,即:在每个终端仅仅将输入信号通过网络传输的情况下,每个终端仍然都处于同步状态。因此,一定要保证每一个地方均有确定的结果,否则无法同步。下面是一些重要注意事项。

There are essentially two sorts of code in spring, synced and unsynced. Which code is what is not as clear as one could wish but essentially the synced code is anything that is reached through CGame::Simframe or handlers of some network msgs, unsynced is everything else (graphic, input, sound etc). Synced code can write anything but should only read synced data. Unsynced code can read anything but must not write synced data. The rest of the points here is essentially about synced code.
spring的代码分两类,1,同步,2,异步。具体哪些是同步哪些是异步,说来话长,但是有一个原则:需要经过CGame::Simframe和网络处理函数的函数例程,都属于同步一类,而其它代码,包括图形显示,用户输入,声音等,都是异步。同步代码可以对任何地方进行【写】操作,但是只能对同步的部分进行【读】操作。异步代码允许对任何地方进行【读】操作,但是决不能对同步部分进行【写】操作。
下面都介绍的是同步代码的原则。

Always make sure to initialize variables. Even if the value doesnt seem to matter it might unsync the simulation.
Be paranoid about array boundaries, reading one byte beyond an array might not crash but it will probably cause sync problems at some point.
一定要初始化变量,否则很可能会造成同步失败的情况。
一定要对数组的边界非常注意。即使不会造成程序崩溃,也会造成同步失败。

For random numbers use the CGlobalStuff::RandFloat etc functions (but never use these from unsynced code)
在同步代码内使用随机数,一定要用CGlobalStuff::RandFloat系列
在非同步代码内使用随机数,一定不能用CGlobalStuff::RandFloat系列

Never compare memory block locations other than for equality. This mean for example that you shouldn’t create a std::set or std::map with a pointer as index if the order might matter.
不能直接比较内存块地址。举例说,不能用指针作为有序的std::set或std::map的序列标志。

[edit] Adding your own stuff
We welcome anyone to make changes to Spring but in order to get them accepted into our distribution the following can be worth thinking about.
添加自己的模块
我们欢迎对spring进行修改。但是如果要我们正式采纳修改,下面几条一定要考虑。

Spring is a game and different people might want different things from it. So if your changes change gameplay it might be a good idea to make it optional.
不同的人对spring存在不同的想法。如果你要修改一些基本元素,请将它作为可选项。
Resources (esp. CPU time) is always in short supply for spring so make sure that you dont waste them needlessly and that your resource usage is in proportion to the impact of your changes.
资源(尤其是CPU)往往是短缺的。最好不要大肆浪费。改进的程度与资源的消耗程度的比例最好能加以控制。
Ask around before starting on a change. Not only might you get tips about how to implement it in the best way but also if anyone else is working on something similar.
改动之前先征求一下意见。不仅可能对你的改动提供方便,也能避免撞车的情况。
Comment your code to make it more readable. In particular use Doxygen style comments so that header comments for classes/methods/functions/fields etc. automatically get pulled into the source code documentation.
最好能注解代码。最好能用Doxygen风格的注释方法,因为这种注释方法能够被自动识别。

看不懂

:lol :lol :lol

看不清楚!!