Skip to content

Commit f68bafe

Browse files
committed
🔥 remove API methods not applicable for season server
1 parent 059f36f commit f68bafe

File tree

3 files changed

+0
-114
lines changed

3 files changed

+0
-114
lines changed

‎api/_config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ marked:
7474

7575
GlobalObjects:
7676
- Game.md
77-
- InterShardMemory.md
7877
- Map.md
7978
- MapVisual.md
8079
- Market.md

‎api/source/Game.md

-87
Original file line numberDiff line numberDiff line change
@@ -122,35 +122,12 @@ not spawned in the world can be accessed here.
122122

123123

124124

125-
{% api_property Game.resources 'object' %}
126-
127-
128-
129-
An object with your global resources that are bound to the account, like pixels or cpu unlocks. Each object key is a resource constant, values are resources amounts.
130-
131-
132-
133125
{% api_property Game.rooms 'object&lt;string, <a href="#Room">Room</a>&gt;' %}
134126

135127

136128

137129
A hash containing all the rooms available to you with room names as hash keys. A room is visible if you have a creep or an owned structure in it.
138130

139-
{% api_property Game.shard 'object' %}
140-
141-
An object describing the world shard where your script is currently being executed in.
142-
143-
{% api_method_params %}
144-
name : string
145-
The name of the shard.
146-
===
147-
type : string
148-
Currently always equals to `normal`.
149-
===
150-
ptr : boolean
151-
Whether this shard belongs to the [PTR](/ptr.html).
152-
{% endapi_method_params %}
153-
154131
{% api_property Game.spawns 'object&lt;string, <a href="#StructureSpawn">StructureSpawn</a>&gt;' %}
155132

156133
```javascript
@@ -252,70 +229,6 @@ Game.cpu.halt();
252229

253230
Reset your runtime environment and wipe all data in heap memory.
254231

255-
{% api_method Game.cpu.setShardLimits 'limits' 1 %}
256-
257-
```javascript
258-
Game.cpu.setShardLimits({shard0: 20, shard1: 10});
259-
```
260-
261-
Allocate CPU limits to different shards. Total amount of CPU should remain equal to
262-
[`Game.cpu.shardLimits`](#Game.cpu). This method can be used only once per 12 hours.
263-
264-
{% api_method_params %}
265-
limits : object&lt;string, number&gt;
266-
An object with CPU values for each shard in the same format as `Game.cpu.shardLimits`.
267-
{% endapi_method_params %}
268-
269-
270-
### Return value
271-
272-
One of the following codes:
273-
{% api_return_codes %}
274-
OK | The operation has been scheduled successfully.
275-
ERR_BUSY | 12-hours cooldown period is not over yet.
276-
ERR_INVALID_ARGS | The argument is not a valid shard limits object.
277-
{% endapi_return_codes %}
278-
279-
280-
{% api_method Game.cpu.unlock '' 1 %}
281-
282-
```javascript
283-
if(Game.cpu.unlockedTime && ((Game.cpu.unlockedTime - Date.now()) < 1000*60*60*24)) {
284-
Game.cpu.unlock();
285-
}
286-
```
287-
288-
Unlock full CPU for your account for additional 24 hours. This method will consume 1 CPU unlock bound to your account (See [`Game.resources`](#Game.resources)).
289-
If full CPU is not currently unlocked for your account, it may take some time (up to 5 minutes) before unlock is applied to your account.
290-
291-
### Return value
292-
293-
One of the following codes:
294-
{% api_return_codes %}
295-
OK | The operation has been scheduled successfully.
296-
ERR_FULL | Your CPU is unlocked with a subscription.
297-
ERR_NOT_ENOUGH_RESOURCES | Your account does not have enough `cpuUnlock` resource.
298-
{% endapi_return_codes %}
299-
300-
{% api_method Game.cpu.generatePixel '' 3 %}
301-
302-
```javascript
303-
if(Game.cpu.bucket == 10000) {
304-
Game.cpu.generatePixel();
305-
}
306-
```
307-
308-
Generate 1 pixel resource unit for 10000 CPU from your bucket.
309-
310-
### Return value
311-
312-
One of the following codes:
313-
{% api_return_codes %}
314-
OK | The operation has been scheduled successfully.
315-
ERR_NOT_ENOUGH_RESOURCES | Your bucket does not have enough CPU.
316-
{% endapi_return_codes %}
317-
318-
319232
{% api_method Game.getObjectById 'id' 1 %}
320233

321234
```javascript

‎api/source/RawMemory.md

-26
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,6 @@ The segment contents.
4646

4747

4848

49-
{% api_property RawMemory.interShardSegment 'string' '{"deprecated": "Please use [`InterShardMemory`](#InterShardMemory) instead."}'%}
50-
51-
```javascript
52-
RawMemory.interShardSegment = JSON.stringify({
53-
creeps: {
54-
Bob: {role: 'claimer'}
55-
}
56-
});
57-
58-
// on another shard
59-
var interShardData = JSON.parse(RawMemory.interShardSegment);
60-
if(interShardData.creeps[creep.name]) {
61-
creep.memory = interShardData[creep.name];
62-
delete interShardData.creeps[creep.name];
63-
}
64-
RawMemory.interShardSegment = JSON.stringify(interShardData);
65-
```
66-
67-
A string with a shared memory segment available on every world shard. Maximum string length is 100 KB.
68-
69-
**Warning:** this segment is not safe for concurrent usage! All shards have shared access to the same instance of data.
70-
When the segment contents is changed by two shards simultaneously, you may lose some data, since the segment string
71-
value is written all at once atomically. You must implement your own system to determine when each shard is allowed to
72-
rewrite the inter-shard memory, e.g. based on [mutual exclusions](https://en.wikipedia.org/wiki/Mutual_exclusion).
73-
74-
7549
{% api_method RawMemory.get '' 0 %}
7650

7751
```javascript

0 commit comments

Comments
 (0)