aboutsummaryrefslogtreecommitdiffstats
path: root/doc/phpdoc/packages/inc.savegame.inc.html
blob: 40091305607c7f075470db46c815e1501778c213 (plain)
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>     &raquo; \inc\savegame.inc
</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

            <link href="../css/template.css" rel="stylesheet" media="all"/>
    
            <!--[if lt IE 9]>
        <script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
        <![endif]-->
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
        <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script>
        <script src="../js/bootstrap.js" type="text/javascript"></script>
        <script src="../js/template.js" type="text/javascript"></script>
        <script src="../js/prettify/prettify.min.js" type="text/javascript"></script>
    
            <link rel="shortcut icon" href="../img/favicon.ico"/>
        <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>
    </head>
<body>

        <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span> <span class="icon-bar"></span>
                    <span class="icon-bar"></span> </a>
                <a class="brand" href="../index.html">API Documentation</a>

                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                API Documentation <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                                                                            </ul>
                        </li>
                        <li class="dropdown" id="charts-menu">
                            <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                Charts <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../graph_class.html">
                                        <i class="icon-list-alt"></i>&#160;Class hierarchy diagram
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown" id="reports-menu">
                            <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                Reports <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../errors.html">
                                        <i class="icon-list-alt"></i>&#160;Errors
                                    </a>
                                </li>
                                <li>
                                    <a href="../markers.html">
                                        <i class="icon-list-alt"></i>&#160;Markers
                                    </a>
                                </li>
                                <li>
                                    <a href="../deprecated.html">
                                        <i class="icon-list-alt"></i>&#160;Deprecated
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="go_to_top">
            <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>
        </div>
    </div>
    
    <div id="___" class="container">
        <noscript>
            <div class="alert alert-warning">
                Javascript is disabled; several features are only available if Javascript is enabled.
            </div>
        </noscript>

        
            
    <div class="row">

        <div class="span4">
            <div class="btn-group view pull-right" data-toggle="buttons-radio">
                <button class="btn details" title="Show descriptions and method names">
                    <i class="icon-list"></i></button><button class="btn simple" title="Show only method names">
                    <i class="icon-align-justify"></i>
                </button>
            </div>
            <ul class="side-nav nav nav-list">
                <li class="nav-header">
                    <i class="icon-map-marker"></i> Packages
                </li>
                <a href="../packages/inc.savegame.inc.html" title="savegame.inc">
                    <i class="icon-th"></i> savegame.inc
                </a>
                <ul class="nav nav-list nav-packages">
                        
    
                </ul>
            </ul>
        </div>

        <div class="span8 package-contents">
                
    <ul class="breadcrumb">
        <li><a href="../index.html"><i class="icon-th"></i></a></li>
            
                
    
    <li>
        <span class="divider">\</span><a href="../packages/inc.html">inc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../packages/inc.savegame.inc.html">savegame.inc</a>
    </li>

    </ul>

    
                    <div class="package-indent">
                <h3><i class="icon-custom icon-function"></i> Functions</h3>
                                        <div id="genXML" class="element ajax clickable function">
        <h1>genXML<a href="../namespaces/default.html#function_genXML"></a></h1>
        <p class="short_description">Recursively generates an XML tree from an array.</p>
        <div class="details collapse">If objects are found, call addToXML() methods which should serialize the object as a child of the XML tree passed as parameter.</div>
        <a href="../namespaces/default.html#function_genXML" class="more">« More »</a>
    </div>

                                        <div id="genSave" class="element ajax clickable function">
        <h1>genSave<a href="../namespaces/default.html#function_genSave"></a></h1>
        <p class="short_description">Generates the XML save tree from the session.</p>
        <div class="details collapse"></div>
        <a href="../namespaces/default.html#function_genSave" class="more">« More »</a>
    </div>

                                        <div id="genFilename" class="element ajax clickable function">
        <h1>genFilename<a href="../namespaces/default.html#function_genFilename"></a></h1>
        <p class="short_description">Generates the save file name using current date/time.</p>
        <div class="details collapse">The date function will use the server&#039;s timezone which could be inconsistent with the client timezone.</div>
        <a href="../namespaces/default.html#function_genFilename" class="more">« More »</a>
    </div>

                                        <div id="saveGame" class="element ajax clickable function">
        <h1>saveGame<a href="../namespaces/default.html#function_saveGame"></a></h1>
        <p class="short_description">Save the XML save tree as an XML file named after the results of genFilename in SAVEDIR.</p>
        <div class="details collapse">Fails and send an error the the client if permissions are incorrectly set. Watch for errors in PHP log.</div>
        <a href="../namespaces/default.html#function_saveGame" class="more">« More »</a>
    </div>

                                        <div id="downSave" class="element ajax clickable function">
        <h1>downSave<a href="../namespaces/default.html#function_downSave"></a></h1>
        <p class="short_description">Sends the current game or a specific save file given by the filename GET parameter to the client.</p>
        <div class="details collapse"></div>
        <a href="../namespaces/default.html#function_downSave" class="more">« More »</a>
    </div>

                                        <div id="listSaves" class="element ajax clickable function">
        <h1>listSaves<a href="../namespaces/default.html#function_listSaves"></a></h1>
        <p class="short_description">Sends the list of available saves to the client.</p>
        <div class="details collapse">Warning: this function changes directory.</div>
        <a href="../namespaces/default.html#function_listSaves" class="more">« More »</a>
    </div>

                                        <div id="parseSave" class="element ajax clickable function">
        <h1>parseSave<a href="../namespaces/default.html#function_parseSave"></a></h1>
        <p class="short_description">Reads an XML tree and deserializes it to an array.</p>
        <div class="details collapse"></div>
        <a href="../namespaces/default.html#function_parseSave" class="more">« More »</a>
    </div>

                                        <div id="deleteSave" class="element ajax clickable function">
        <h1>deleteSave<a href="../namespaces/default.html#function_deleteSave"></a></h1>
        <p class="short_description">Deletes a save file given as the filename POST parameter.</p>
        <div class="details collapse"></div>
        <a href="../namespaces/default.html#function_deleteSave" class="more">« More »</a>
    </div>

                                        <div id="loadSave" class="element ajax clickable function">
        <h1>loadSave<a href="../namespaces/default.html#function_loadSave"></a></h1>
        <p class="short_description">Loads a save file given as the filename POST parameter to the session.</p>
        <div class="details collapse">Empties the session beforehand.</div>
        <a href="../namespaces/default.html#function_loadSave" class="more">« More »</a>
    </div>

                                        <div id="uploadSave" class="element ajax clickable function">
        <h1>uploadSave<a href="../namespaces/default.html#function_uploadSave"></a></h1>
        <p class="short_description">Reads a save file sent by the client.</p>
        <div class="details collapse">Parse the received file then generate it again to clean it for any unwanted
and make sure that it is a valid XML save file.
XML errors are simply ignored and an error is sent to the client if something wrong happens.</div>
        <a href="../namespaces/default.html#function_uploadSave" class="more">« More »</a>
    </div>

                            </div>
        
                    <div class="package-indent">
                <h3><i class="icon-custom icon-constant"></i> Constants</h3>
                                        <div id="SAVEDIR" class="element ajax clickable constant">
        <h1>SAVEDIR<a href="../namespaces/default.html#constant_SAVEDIR"></a></h1>
        <p class="short_description">Directory to save to and load from.</p>
        <div class="details collapse">The PHP/Apache user must have write permission on this directory.
Use the following commands to give write permissions to the http group:
&lt;samp&gt;
sudo chown :http data/save
sudo chmod g+w data/save
&lt;/samp&gt;</div>
        <a href="../namespaces/default.html#constant_SAVEDIR" class="more">« More »</a>
    </div>

                            </div>
        
            
    
        </div>
    </div>
    </div>

        <footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by
            <a href="http://glyphicons.com/">Glyphicons</a>.<br/>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/>
            generated on Sun, 08 May 2016 20:44:21 +0200.<br/>
    </footer>
    </body>
</html>