tx · AyWiKygZMyfzpH7d6k18YKWAWp2fbZBg18vayhJsMZmS 3N1x2A7NumZqydu5zGntLZSMe26rcpdyoss: -0.04000000 Waves 2020.08.15 15:00 [1133674] smart account 3N1x2A7NumZqydu5zGntLZSMe26rcpdyoss > SELF 0.00000000 Waves
{ "type": 13, "id": "AyWiKygZMyfzpH7d6k18YKWAWp2fbZBg18vayhJsMZmS", "fee": 4000000, "feeAssetId": null, "timestamp": 1597492869349, "version": 1, "sender": "3N1x2A7NumZqydu5zGntLZSMe26rcpdyoss", "senderPublicKey": "7EaUr5Z6zmEQJXz7jVWXjW7xbJLakPjxFPTZFogi8wzr", "proofs": [ "2FMwgMKdSW8Ma2dMjEcqngsXTuaJP5MLZSN8f8GKuXEparAW4aYTxYu2oorDDFQHshEBNBiPTSwUKo3kRhHd3eB2" ], "script": "base64:AAIDAAAAAAAAABEIARIECgIBARIFCgMBAQESAAAAAA0BAAAACXNldENvb3JkcwAAAAMAAAADa2V5AAAACGxhdGl0dWRlAAAACWxvbmdpdHVkZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAAxwb3NpdGlvbkxhdF8FAAAAA2tleQUAAAAIbGF0aXR1ZGUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAMcG9zaXRpb25Mb25fBQAAAANrZXkFAAAACWxvbmdpdHVkZQUAAAADbmlsAQAAAAtzZXRHYW1lRGF0YQAAAAIAAAAJcGxheWVyS2V5AAAAC29wcG9uZW50S2V5BAAAAAZnYW1lSWQJAAEsAAAAAgkAASwAAAACBQAAAAlwbGF5ZXJLZXkCAAAAAV8FAAAAC29wcG9uZW50S2V5CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAB2dhbWVJZF8FAAAACXBsYXllcktleQUAAAAGZ2FtZUlkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAACW9wcG9uZW50XwUAAAAJc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aQAAAAZjYWxsZXIFAAAABWFzc2V0AwkAAGYAAAACAAAAAAAAAABkBQAAAAdiYWxhbmNlCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAZAUAAAAFYXNzZXQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAIEVcL0=", "chainId": 84, "height": 1133674, "spentComplexity": 0 } View: original | compacted Prev: AxywN1Ngm44tDHAwKYA2qJpjZi8c9QVKGLFYegnT87hJ Next: BMKtc43jnPTThiv8YWxXVZhRuh4wRHVeAdwXpVRmNt4H Diff:
Old | New | Differences | |
---|---|---|---|
205 | 205 | then true | |
206 | 206 | else (openGame == caller)) | |
207 | 207 | then WriteSet(DataEntry("openGame", caller) :: coordinates) | |
208 | - | else WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], setGameData(value(openGame), caller)]) | |
208 | + | else { | |
209 | + | let playerLatitude = getIntegerValue(this, ("positionLat_" + value(openGame))) | |
210 | + | let playerLongitude = getIntegerValue(this, ("positionLon_" + value(openGame))) | |
211 | + | let distanceBetweenPlayers = gpsDistance(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude) | |
212 | + | let hash = sha256(toBytes(distanceBetweenPlayers)) | |
213 | + | let number = toInt(hash) | |
214 | + | let offset = ((number % (628318 / 4)) - (628318 / 8)) | |
215 | + | let playerYaw = coordinatesToAngleInRad(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude) | |
216 | + | let playerOffsetYaw = (playerYaw + offset) | |
217 | + | let opponentYaw = ((playerYaw + 314159) % 628318) | |
218 | + | let opponentOffsetYaw = (opponentYaw + offset) | |
219 | + | WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], DataEntry(("opponentOffsetYaw_" + caller), playerOffsetYaw), DataEntry(("opponentOffsetYaw_" + value(openGame)), opponentOffsetYaw), setGameData(value(openGame), caller)]) | |
220 | + | } | |
209 | 221 | } | |
210 | 222 | else throw("Please pay the token") | |
211 | 223 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func setCoords (key,latitude,longitude) = [DataEntry(("positionLat_" + key), latitude), DataEntry(("positionLon_" + key), longitude)] | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func setGameData (playerKey,opponentKey) = { | |
8 | 8 | let gameId = ((playerKey + "_") + opponentKey) | |
9 | 9 | [DataEntry(("gameId_" + playerKey), gameId), DataEntry(("opponent_" + playerKey), opponentKey), DataEntry(("gameId_" + opponentKey), gameId), DataEntry(("opponent_" + opponentKey), playerKey), DataEntry(("game_" + gameId), true), DataEntry(("gameTurn_" + gameId), playerKey), DataEntry(("gameWinner_" + gameId), "")] | |
10 | 10 | } | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getGameId (key) = getStringValue(this, ("gameId_" + key)) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func sin (rad) = { | |
17 | 17 | let factor = (rad / 628318) | |
18 | 18 | if ((0 > rad)) | |
19 | 19 | then { | |
20 | 20 | let positive = -(rad) | |
21 | 21 | if ((positive > 628318)) | |
22 | 22 | then { | |
23 | 23 | let norm = (positive + (factor * 628318)) | |
24 | 24 | if ((norm > 314159)) | |
25 | 25 | then { | |
26 | 26 | let norm2 = (norm - 314159) | |
27 | 27 | let a = ((16 * norm2) * (314159 - norm2)) | |
28 | 28 | let b = (493480220050 - (a / 4)) | |
29 | 29 | ((a * 100000) / b) | |
30 | 30 | } | |
31 | 31 | else { | |
32 | 32 | let a = ((16 * norm) * (314159 - norm)) | |
33 | 33 | let b = (493480220050 - (a / 4)) | |
34 | 34 | ((-(a) * 100000) / b) | |
35 | 35 | } | |
36 | 36 | } | |
37 | 37 | else if ((positive > 314159)) | |
38 | 38 | then { | |
39 | 39 | let norm = (positive - 314159) | |
40 | 40 | let a = ((16 * norm) * (314159 - norm)) | |
41 | 41 | let b = (493480220050 - (a / 4)) | |
42 | 42 | ((a * 100000) / b) | |
43 | 43 | } | |
44 | 44 | else { | |
45 | 45 | let a = ((16 * positive) * (314159 - positive)) | |
46 | 46 | let b = (493480220050 - (a / 4)) | |
47 | 47 | ((-(a) * 100000) / b) | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | else if ((rad > 628318)) | |
51 | 51 | then { | |
52 | 52 | let norm = (rad - (factor * 628318)) | |
53 | 53 | if ((norm > 314159)) | |
54 | 54 | then { | |
55 | 55 | let norm2 = (norm - 314159) | |
56 | 56 | let a = ((16 * norm2) * (314159 - norm2)) | |
57 | 57 | let b = (493480220050 - (a / 4)) | |
58 | 58 | ((-(a) * 100000) / b) | |
59 | 59 | } | |
60 | 60 | else { | |
61 | 61 | let a = ((16 * norm) * (314159 - norm)) | |
62 | 62 | let b = (493480220050 - (a / 4)) | |
63 | 63 | ((a * 100000) / b) | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 | else if ((rad > 314159)) | |
67 | 67 | then { | |
68 | 68 | let norm = (rad - 314159) | |
69 | 69 | let a = ((16 * norm) * (314159 - norm)) | |
70 | 70 | let b = (493480220050 - (a / 4)) | |
71 | 71 | ((-(a) * 100000) / b) | |
72 | 72 | } | |
73 | 73 | else { | |
74 | 74 | let a = ((16 * rad) * (314159 - rad)) | |
75 | 75 | let b = (493480220050 - (a / 4)) | |
76 | 76 | ((a * 100000) / b) | |
77 | 77 | } | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func cos (rad) = sin((157079 - rad)) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func asin (x) = if (if ((-100000 > x)) | |
85 | 85 | then true | |
86 | 86 | else (x > 100000)) | |
87 | 87 | then throw("The asin implementation is defined for x [-1,1]!") | |
88 | 88 | else if ((0 > x)) | |
89 | 89 | then { | |
90 | 90 | let x1 = (-1 * x) | |
91 | 91 | let val4 = ((((((-1873 * x1) / 100000) + 7426) * x1) / 100000) - 21211) | |
92 | 92 | let val6 = (((val4 * x1) / 100000) + 157072) | |
93 | 93 | let root = pow((100000 - x1), 5, 5, 1, 5, HALFEVEN) | |
94 | 94 | -((157080 - ((root * val6) / 100000))) | |
95 | 95 | } | |
96 | 96 | else { | |
97 | 97 | let val2 = (((-1873 * x) / 100000) + 7426) | |
98 | 98 | let val4 = (((val2 * x) / 100000) - 21211) | |
99 | 99 | let val6 = (((val4 * x) / 100000) + 157072) | |
100 | 100 | let root = pow((100000 - x), 5, 5, 1, 5, HALFEVEN) | |
101 | 101 | (157080 - ((root * val6) / 100000)) | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func atan (x) = { | |
106 | 106 | let xPow2 = ((x * x) / 100000) | |
107 | 107 | if ((-100000 > x)) | |
108 | 108 | then (-157079 - ((x * 100000) / (xPow2 + 28000))) | |
109 | 109 | else if ((x > 100000)) | |
110 | 110 | then (157079 - ((x * 100000) / (xPow2 + 28000))) | |
111 | 111 | else ((x * 100000) / (100000 + ((28000 * xPow2) / 100000))) | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func atan2 (y,x) = if ((x > 0)) | |
116 | 116 | then atan(((y * 100000) / x)) | |
117 | 117 | else if (if ((0 > x)) | |
118 | 118 | then (y >= 0) | |
119 | 119 | else false) | |
120 | 120 | then (atan(((y * 100000) / x)) + 314159) | |
121 | 121 | else if (if ((0 > x)) | |
122 | 122 | then (0 > y) | |
123 | 123 | else false) | |
124 | 124 | then (atan(((y * 100000) / x)) - 314159) | |
125 | 125 | else if (if ((x == 0)) | |
126 | 126 | then (y > 0) | |
127 | 127 | else false) | |
128 | 128 | then 157080 | |
129 | 129 | else if (if ((x == 0)) | |
130 | 130 | then (0 > y) | |
131 | 131 | else false) | |
132 | 132 | then -157080 | |
133 | 133 | else 0 | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func calculateShotDistance (v,pitch) = (((2 * v) * ((cos(pitch) * sin(pitch)) / 100000)) / 980665) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func gpsDistance (lat1,lon1,lat2,lon2) = { | |
140 | 140 | let dLat = (lat1 - lat2) | |
141 | 141 | let dLon = (lon1 - lon2) | |
142 | 142 | let dLatSin = sin((dLat / 2)) | |
143 | 143 | let dLonSin = sin((dLon / 2)) | |
144 | 144 | let hav = ((dLatSin * dLatSin) + (((cos(lat1) * cos(lat2)) / 100000) * ((dLonSin * dLonSin) / 100000))) | |
145 | 145 | let theta = (2 * asin(pow((hav / 1000), 7, 5, 1, 5, HALFEVEN))) | |
146 | 146 | ((637100000000 * theta) / 100000) | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func calculateImpactPosition (lat,lon,dist,yaw) = { | |
151 | 151 | let th = (dist / 6371000) | |
152 | 152 | let sinLat = sin(lat) | |
153 | 153 | let cosLat = cos(lat) | |
154 | 154 | let sinTh = sin(th) | |
155 | 155 | let cosTh = cos(th) | |
156 | 156 | let newLat = asin((((sinLat * cosTh) / 100000) + (((cosLat * sinTh) * cos(yaw)) / 10000000000))) | |
157 | 157 | let newLon = (lon + atan2((((sin(yaw) * sinTh) * cosLat) / 10000000000), (cosTh - ((sinLat * sinLat) / 100000)))) | |
158 | 158 | [newLat, newLon] | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func calculateShot (pitch,yaw,force,playerKey,opponentKey) = { | |
163 | 163 | let playerLatitude = getIntegerValue(this, ("positionLat_" + playerKey)) | |
164 | 164 | let playerLongitude = getIntegerValue(this, ("positionLon_" + playerKey)) | |
165 | 165 | let opponentLatitude = getIntegerValue(this, ("positionLat_" + opponentKey)) | |
166 | 166 | let opponentLongitude = getIntegerValue(this, ("positionLon_" + opponentKey)) | |
167 | 167 | let distanceBetweenPlayers = gpsDistance(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude) | |
168 | 168 | let optimalVelocity = ((distanceBetweenPlayers * 980665) / 100000) | |
169 | 169 | let playerShotReach = calculateShotDistance(((optimalVelocity * force) / 100000), pitch) | |
170 | 170 | let impactPosition = calculateImpactPosition(playerLatitude, playerLongitude, playerShotReach, yaw) | |
171 | 171 | let impactDistance = gpsDistance(impactPosition[0], impactPosition[1], opponentLatitude, opponentLongitude) | |
172 | 172 | impactDistance :: impactPosition | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func coordinatesToAngleInRad (lat1,lon1,lat2,lon2) = { | |
177 | 177 | let dLon = (lon1 - lon2) | |
178 | 178 | let x = (sin(dLon) * cos(lat2)) | |
179 | 179 | let y = ((cos(lat1) * sin(lat2)) - ((sin(lat1) * cos(lat2)) * cos(dLon))) | |
180 | 180 | ((atan2(y, x) + 628318) % 628318) | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | @Callable(i) | |
185 | 185 | func startGame (latitude,longitude) = { | |
186 | 186 | let asset = base58'' | |
187 | 187 | let payment = value(i.payment) | |
188 | 188 | let caller = toString(i.caller) | |
189 | 189 | let opponentLatitude = ((latitude * 1745) / 100000) | |
190 | 190 | let opponentLongitude = ((longitude * 1745) / 100000) | |
191 | 191 | let coordinates = setCoords(caller, opponentLatitude, opponentLongitude) | |
192 | 192 | let openGame = getString(this, "openGame") | |
193 | 193 | if (if ((payment.assetId == asset)) | |
194 | 194 | then (payment.amount >= 1) | |
195 | 195 | else false) | |
196 | 196 | then { | |
197 | 197 | let gameId = getString(this, ("gameId_" + caller)) | |
198 | 198 | if (if ((gameId != "")) | |
199 | 199 | then (gameId != unit) | |
200 | 200 | else false) | |
201 | 201 | then throw("Please finish your current game, before starting another one") | |
202 | 202 | else if (!(isDefined(openGame))) | |
203 | 203 | then WriteSet(DataEntry("openGame", caller) :: coordinates) | |
204 | 204 | else if (if ((openGame == "")) | |
205 | 205 | then true | |
206 | 206 | else (openGame == caller)) | |
207 | 207 | then WriteSet(DataEntry("openGame", caller) :: coordinates) | |
208 | - | else WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], setGameData(value(openGame), caller)]) | |
208 | + | else { | |
209 | + | let playerLatitude = getIntegerValue(this, ("positionLat_" + value(openGame))) | |
210 | + | let playerLongitude = getIntegerValue(this, ("positionLon_" + value(openGame))) | |
211 | + | let distanceBetweenPlayers = gpsDistance(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude) | |
212 | + | let hash = sha256(toBytes(distanceBetweenPlayers)) | |
213 | + | let number = toInt(hash) | |
214 | + | let offset = ((number % (628318 / 4)) - (628318 / 8)) | |
215 | + | let playerYaw = coordinatesToAngleInRad(playerLatitude, playerLongitude, opponentLatitude, opponentLongitude) | |
216 | + | let playerOffsetYaw = (playerYaw + offset) | |
217 | + | let opponentYaw = ((playerYaw + 314159) % 628318) | |
218 | + | let opponentOffsetYaw = (opponentYaw + offset) | |
219 | + | WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], DataEntry(("opponentOffsetYaw_" + caller), playerOffsetYaw), DataEntry(("opponentOffsetYaw_" + value(openGame)), opponentOffsetYaw), setGameData(value(openGame), caller)]) | |
220 | + | } | |
209 | 221 | } | |
210 | 222 | else throw("Please pay the token") | |
211 | 223 | } | |
212 | 224 | ||
213 | 225 | ||
214 | 226 | ||
215 | 227 | @Callable(i) | |
216 | 228 | func executeShot (pitch,yaw,force) = { | |
217 | 229 | let asset = base58'' | |
218 | 230 | let caller = toString(i.caller) | |
219 | 231 | let opponent = getStringValue(this, ("opponent_" + caller)) | |
220 | 232 | let gameId = getGameId(caller) | |
221 | 233 | if ((getStringValue(this, ("gameTurn_" + gameId)) != caller)) | |
222 | 234 | then throw("Please wait for your turn.") | |
223 | 235 | else { | |
224 | 236 | let shotData = calculateShot(pitch, yaw, force, caller, opponent) | |
225 | 237 | if ((1000 > shotData[0])) | |
226 | 238 | then ScriptResult(WriteSet([DataEntry(("game_" + gameId), false), DataEntry(("gameWinner_" + gameId), caller), DataEntry(("lastShotDistance_" + gameId), shotData[0]), DataEntry(("lastShotLat_" + gameId), shotData[1]), DataEntry(("lastShotLon_" + gameId), shotData[2])]), TransferSet([ScriptTransfer(i.caller, 2, asset)])) | |
227 | 239 | else WriteSet([DataEntry(("gameTurn_" + gameId), opponent), DataEntry(("lastShotDistance_" + gameId), shotData[0]), DataEntry(("lastShotLat_" + gameId), shotData[1]), DataEntry(("lastShotLon_" + gameId), shotData[2])]) | |
228 | 240 | } | |
229 | 241 | } | |
230 | 242 | ||
231 | 243 | ||
232 | 244 | ||
233 | 245 | @Callable(i) | |
234 | 246 | func faucet () = { | |
235 | 247 | let asset = base58'' | |
236 | 248 | let caller = toString(i.caller) | |
237 | 249 | let balance = assetBalance(i.caller, asset) | |
238 | 250 | if ((100 > balance)) | |
239 | 251 | then TransferSet([ScriptTransfer(i.caller, 100, asset)]) | |
240 | 252 | else TransferSet(nil) | |
241 | 253 | } | |
242 | 254 | ||
243 | 255 |
github/deemru/w8io/026f985 67.13 ms ◑